<script setup>
import { computed, ref } from 'vue';

const totalCount=ref(100)

const disCount = computed(()=>totalCount.value * 0.8)
const arr = ref([1,2,3,4,5])

const doubleArr = computed(()=>{
  return arr.value.map(item=>item*2)
})
</script>


<template>
<h1>原价：{{ totalCount }}</h1>
<h2>折后价：{{ disCount }}</h2>
<button @click="totalCount += 100">修改原价</button>
<p>{{ arr }}</p>
<p>{{ doubleArr }}</p>
<button @click="arr.push(100)">修改原价</button>
</template>

<style scoped>
</style>
